<?php

namespace app\uni\controller;


use think\Controller;

// 微信公众号封装类
use EasyWeChat\Factory;

class Airline extends Controller
{
    public function _initialize()
    {
        $this->AirlineModel = model('Airline.Airline');
        $this->PointsModel = model('Airline.Points');
        $this->PssdModel = model('Airline.Pssd');
        $this->OrderModel = model('Order.Order');
    }


    // 所有时间段
    public function timelist(){
        $list=$this->PssdModel->order('id')->select();

        $this->success('','',$list);
      }

    // 所有航线列表
    public function alllines(){
        $list=$this->AirlineModel->order('id')->select();

        $this->success('','',$list);
    }

    // 获取筛选航线
    public function airline(){
        $date = $this->request->param('date', '', 'trim');
        $id = $this->request->param('id', '', 'trim');

        $data=$this->AirlineModel->where('id',$id)->order('id')->select();

        $this->success('','',$data);
      }

    // 获取筛选时间段
    public function selecttime(){
        $timeid = $this->request->param('timeid', '', 'trim');
        $data=$this->AirlineModel->where('id',$timeid)->select();

        $this->success('','',$data);
      }

    // 途经点列表
    public function pointslist(){
        $airlineid = $this->request->param('airlineid', '', 'trim');
        $data=$this->PointsModel->where('airline_id',$airlineid)->order('id')->select();

        $this->success('','',$data);
      }

    // 配送时段列表
    public function pssdlist(){
        $data=$this->PssdModel->order('begin_time')->select();

        $this->success('','',$data);
    }
    
}
